'''
盒子属性: 长宽高
方法: 1. 计算总表面积 2. 计算体积
2021-8-13 Nasa
'''


class Box:
    def __init__(self, chang, kuan, gao):
        self.chang = chang
        self.kuan = kuan
        self.gao = gao

    def mianji(self):
        x = self.gao * self.kuan * 2
        y = self.gao * self.chang * 2
        z = self.chang * self.kuan * 2
        mianji = x + y + z
        return mianji

    def tiji(self):
        tiji = self.chang * self.kuan * self.gao
        return tiji

    def __str__(self):
        return f'长:{self.chang} 宽:{self.kuan} 高:{self.gao}'


if __name__ == '__main__':
    thebox = Box(4, 5, 3)
    mianji = thebox.mianji()
    tiji = thebox.tiji()
    print(thebox, mianji, tiji)
